package soccerBet.project.agenda;

import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.Semaphore;

import soccerBet.project.main.ServiceManager;
import soccerBet.project.objects.Jogo;

public class RemindTask extends TimerTask {
	
    Jogo jogo;
    Timer timer;
    Semaphore semaphore;
    
    public RemindTask(Jogo jog, Timer timer, Semaphore semaphore) {
    	this.jogo=jog;
    	this.timer=timer;
    	this.semaphore=semaphore;
	}

	public void run() {
    	(new ServiceManager(this.jogo,semaphore)).start();
        timer.cancel(); //Terminate the timer thread
    }
}
